<?php
namespace Agent\Controller;

class Order2Controller extends CommonController {
	
public function __construct() {
		parent::__construct ();
		parent::__config ( array (
				'model_name'=>'Order',
		) );
	}
	
	public function index(){
				$agent_info = session("ssc_agent");
				$user_ids_str = get_agent_user_ids($agent_info['agent_id']);
				parent::__config ( array (
						'fuzzy'=>'username',
						'relation'=>true,
						'ids_in'=>'user_id', 
						'ids_in_str'=>$user_ids_str,
						'search'=>true,
						'where_string'=>'order_statue',
						'where_string_value'=>2,
						'between_time'=>'review_time',
						'statistics'=>'money',//需要统计求和字段
				) );
				$table =I('table');
				if (!$table == null && ! empty ($table)) {
					parent::__config ( array (
							'display' => 'table' ,
							'display_parms'=>array('table'=>1),
					) );
				};
				parent::index ();
	}
	
	function add() {
		parent::add ();
	}
	function insert() {
		parent::__config ( array (
				'display'=>'index',
		) );
	}
	
	function foreverdelete() {
// 		parent::__config ( array (
// 				'display' => 'index?table=1' ,
// 		) );
// 		parent::foreverdelete ();
	}
	
	function edit() {
		parent::__config ( array (
				'display'=>'index',
		) );
		$data['id']=I('id');
		$data['status']=1;
		parent::update ($data);
// 		parent::edit ();
	}
	
	function update() {
		parent::__config ( array (
				'display'=>'index',
		) );
		$data['id']=I('id');
		$data['status']=0;
		parent::update ($data);
	}
	function logout(){
		session("bm_ouradmin",null);
		session('Order',null);
		$this->redirect('Home/Index/index');
	}
	
	function bean() {
		parent::bean();
	}
	
	function sort() {
		parent::sort ();
	}
	
	function excelImport(){
	}
	
	function excelOutput(){
		
	}
	
}